package com.ttg.common.enums;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public enum TaskEnum {

    MCT_RATING_CURRENT_DEPOSIT("MCT_RATING_CURRENT_DEPOSIT","根据客户活期存款更新成长值和积分任务"),
    MCT_RATING_FINANCING("MCT_RATING_FINANCING","根据客户理财金额更新成长值和积分任务"),
    MCT_RATING_LOAN_AMOUNT("MCT_RATING_LOAN_AMOUNT","根据客户贷款更新成长值和积分任务"),
    MCT_RATING_PERIODICALLY_DEPOSIT("MCT_RATING_PERIODICALLY_DEPOSIT","根据客户定期存款更新成长值和积分任务"),
    MCT_RATING_PRACTISE_YEAR("MCT_RATING_PRACTISE_YEAR","根据客户从业年限更新成长值和积分任务"),
    MCT_RATING_QUARTER_TRANSACTION_AMOUNT("MCT_RATING_QUARTER_TRANSACTION_AMOUNT","根据客户近三个月收单金额更新成长值和积分任务"),
    MCT_RATING_QUARTER_TRANSACTION_NUMBER("MCT_RATING_QUARTER_TRANSACTION_NUMBER","根据客户近三个月收单笔数更新成长值和积分任务"),
    MCT_RATING_REGISTER_YEAR("MCT_RATING_REGISTER_YEAR","根据客户注册年限更新成长值和积分任务"),
    MCT_RATING_TRANSACTION_AMOUNT("MCT_RATING_TRANSACTION_AMOUNT","根据客户收单金额更新成长值和积分任务"),
    MCT_RATING_TRANSACTION_MOUTH_NUMBER("MCT_RATING_TRANSACTION_MOUTH_NUMBER","根据客户有效交易月份数更新成长值和积分任务"),
    MCT_RATING_TRANSACTION_NUMBER("MCT_RATING_TRANSACTION_NUMBER","根据客户收单笔数更新成长值和积分任务"),

    VIP_RATING_AUM("VIP_RATING_AUM","根据客户金融值更新成长值和积分任务"),

    GET_BANK_INFO_BY_UNL("GET_BANK_INFO_BY_UNL","从数仓获取贡献度和全员营销数据任务"),
    MCT_TAG_BIND("MCT_TAG_BIND","更新个人用户规则任务"),
    VIP_TAG_BIND("VIP_TAG_BIND","更新商户用户规则任务"),
    EDIT_VIP_RATING("EDIT_VIP_RATING","更新个人用户等级任务"),
    EDIT_MCT_RATING("EDIT_MCT_RATING","更新商户用户等级任务"),
    NEW_MCT_RATING("NEW_MCT_RATING","新商户评级任务"),
    NEW_VIP_RATING("NEW_VIP_RATING","新用户评级任务"),
    VIP_PEOPLE_BIND("VIP_PEOPLE_BIND","更新个人用户人群规则任务"),
    MCT_PEOPLE_BIND("MCT_PEOPLE_BIND","更新商户用户人群规则任务"),

    TAG_BIND_BACK_UP("TAG_BIND_BACK_UP","标签命中记录备份任务"),
    GENERATE_TZG_ZIP("GENERATE_TZG_ZIP","生成数据文件提供给TZG下载"),

    /*质量管理任务*/
    QM_INDUSTRY_SCORE("QM_INDUSTRY_SCORE","质量管理-行业得分计算"),
    QM_INDUSTRY_CLASSIFICATION("QM_INDUSTRY_CLASSIFICATION","质量管理-行业质量指导分类计算"),
    QM_MERCH_SCORE("QM_MERCH_SCORE","质量管理-商户得分计算"),
    QM_MERCH_CLASSIFICATION("QM_MERCH_CLASSIFICATION","质量管理-商户质量指导分类计算"),

    /*成本管理任务*/
    CM_INDUSTRY_DEPOSIT_BY_YEAR("CM_INDUSTRY_DEPOSIT_BY_YEAR","成本管理-行业存贷信息计算-按年"),
    CM_INDUSTRY_DEPOSIT_BY_MONTH("CM_INDUSTRY_DEPOSIT_BY_MONTH","成本管理-行业存贷信息计算-按月"),
    CM_MERCH_DEPOSIT_BY_YEAR("CM_MERCH_DEPOSIT_BY_YEAR","成本管理-商户存贷信息计算-按年"),
    CM_MERCH_DEPOSIT_BY_MONTH("CM_MERCH_DEPOSIT_BY_MONTH","成本管理-商户存贷信息计算-按月"),
    CM_ACCT_DEPOSIT_ANALYSIS_BY_YEAR("CM_ACCT_DEPOSIT_ANALYSIS_BY_YEAR","成本管理-直绑/全量账户存款结构分解清算-按年"),
    CM_ACCT_DEPOSIT_ANALYSIS_BY_MONTH("CM_ACCT_DEPOSIT_ANALYSIS_BY_MONTH","成本管理-直绑/全量账户存款结构分解清算-按月"),
    CM_ACCT_COMPREHENSIVE_ANALYSIS_BY_YEAR("CM_ACCT_COMPREHENSIVE_ANALYSIS_BY_YEAR","成本管理-直绑/全量账户综合结构分解清算-按年"),
    CM_ACCT_COMPREHENSIVE_ANALYSIS_BY_MONTH("CM_ACCT_COMPREHENSIVE_ANALYSIS_BY_MONTH","成本管理-直绑/全量账户综合结构分解清算-按月"),
    CM_COST_GRADING("CM_COST_GRADING","成本管理-商户成本分档"),
    ;

    private final String taskTag;

    private final String taskName;

    TaskEnum(String taskTag, String taskName){
        this.taskTag = taskTag;
        this.taskName = taskName;
    }

    public String getTaskTag() {
        return taskTag;
    }

    public String getTaskName() {
        return taskName;
    }

    /**
     * 全部积分任务
     */
    private static final List<String> allIntegralTasks = new ArrayList<>();

    /**
     * 个人积分任务
     */
    private static final List<String> vipIntegralTasks = new ArrayList<>();

    /**
     * 商户积分任务
     */
    private static final List<String> mctIntegralTasks = new ArrayList<>();

    static  {

        mctIntegralTasks.add(TaskEnum.MCT_RATING_CURRENT_DEPOSIT.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_FINANCING.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_LOAN_AMOUNT.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_PERIODICALLY_DEPOSIT.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_PRACTISE_YEAR.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_QUARTER_TRANSACTION_AMOUNT.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_QUARTER_TRANSACTION_NUMBER.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_REGISTER_YEAR.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_TRANSACTION_AMOUNT.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_TRANSACTION_MOUTH_NUMBER.getTaskTag());
        mctIntegralTasks.add(TaskEnum.MCT_RATING_TRANSACTION_NUMBER.getTaskTag());



        vipIntegralTasks.add(TaskEnum.VIP_RATING_AUM.getTaskTag());


        allIntegralTasks.addAll(mctIntegralTasks);
        allIntegralTasks.addAll(vipIntegralTasks);
    }


    public static Boolean isIntegralTask (TaskEnum taskEnum){
        if (Objects.isNull(taskEnum)){
            return false;
        }
        return allIntegralTasks.contains(taskEnum.getTaskTag());
    }


    public static Boolean isMctIntegralTask (TaskEnum taskEnum){
        if (Objects.isNull(taskEnum)){
            return false;
        }
        return mctIntegralTasks.contains(taskEnum.getTaskTag());
    }

    public static Boolean isVipIntegralTask (TaskEnum taskEnum){
        if (Objects.isNull(taskEnum)){
            return false;
        }
        return vipIntegralTasks.contains(taskEnum.getTaskTag());
    }

}
